package com.zhuiYun.project.api.menu.mapper;

import com.zhuiYun.project.api.menu.entity.MenuEntity;
import com.zhuiYun.project.common.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author dongdong
 * @Date 2023/4/3 19:58
 **/
@Mapper
public interface MenuMapper extends BaseMapper<MenuEntity> {

    @Select("SELECT * FROM `sys_menu` where menu_type = 0")
    List<MenuEntity> getMenuNotFunction();
    @Select("select b.* from  sys_menu b left join sys_user_power a on a.menu_id = b.id where a.user_id = #{id} and b.menu_type !=2")
    List<MenuEntity> getMenuByUser(Integer id);
}
